﻿<wpfc:HostControl x:Class="Sobiens.Connectors.WPF.Controls.ContentExplorer"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:wpfc="clr-namespace:Sobiens.Connectors.WPF.Controls"
             xmlns:my1="clr-namespace:Sobiens.Connectors.WPF.Controls"
             xmlns:jas="clr-namespace:WPF.JoshSmith.ServiceProviders.UI"
             VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Margin="5,0,0,0" VerticalContentAlignment="Stretch" BorderBrush="{x:Null}" Background="{x:Null}">
    <UserControl.Resources>

        <Style x:Key="ItemContStyle" TargetType="ListViewItem">
            <Style.Resources>
                <LinearGradientBrush x:Key="MouseOverBrush" StartPoint="0.5, 0" EndPoint="0.5, 1">
                    <GradientStop Color="#110000ff" Offset="0" />
                    <GradientStop Color="#330000ff" Offset="0.4" />
                    <GradientStop Color="#440000ff" Offset="0.6" />
                    <GradientStop Color="#220000ff" Offset="0.9" />
                    <GradientStop Color="#110000ff" Offset="1" />
                </LinearGradientBrush>
            </Style.Resources>
            <Style.Triggers>
                <Trigger Property="jas:ListViewItemDragState.IsBeingDragged" Value="True">
                    <Setter Property="FontWeight" Value="DemiBold" />
                </Trigger>
                <Trigger Property="jas:ListViewItemDragState.IsUnderDragCursor" Value="True">
                    <Setter Property="Background" Value="{StaticResource MouseOverBrush}" />
                </Trigger>
            </Style.Triggers>
        </Style>
    </UserControl.Resources>
    <DockPanel x:Name="rootDockPanel" ClipToBounds="False" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" ForceCursor="True" LastChildFill="True" Margin="0,0,0,0">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="25"/>
                <RowDefinition Height="100*"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="100"/>
                <ColumnDefinition Width="100*"/>
            </Grid.ColumnDefinitions>
            <StackPanel Grid.Row="0" Grid.Column="0" DockPanel.Dock="Top" Name="ListViewActionPanel" Orientation="Horizontal" Height="25" VerticalAlignment="Top" HorizontalAlignment="Left">
                <Button ToolTip="New" BorderThickness="0" Width="25" Height="21" VerticalAlignment="Top" HorizontalAlignment="Left" Click="NewButton_Click" Background="Transparent" Name="NewButton">
                    <Button.Content>
                        <StackPanel Orientation="Horizontal">
                            <Image Source="Images/NewItem.png" Height="20" Width="20" />
                        </StackPanel>
                    </Button.Content>
                    <Button.ContextMenu>
                        <ContextMenu Name="NewButtonContextMenu">
                            <MenuItem Header="Folder" Name="FolderNewMenuItem" Click="FolderNewMenuItem_Click" >
                                <MenuItem.Icon>
                                    <Image Source="Images/mb_folder.png" />
                                </MenuItem.Icon>
                            </MenuItem>
                            <MenuItem Header="File Upload" Name="NewFileUploadMenuItem" Click="NewFileUploadMenuItem_Click">
                                <MenuItem.Icon>
                                    <Image Source="Images/FileUpload.png" />
                                </MenuItem.Icon>
                            </MenuItem>
                            <MenuItem Header="Word Document" Name="NewWordDocumentMenuItem" Click="NewWordDocumentMenuItem_Click">
                                <MenuItem.Icon>
                                    <Image Source="Images/lg_icdocx.png" />
                                </MenuItem.Icon>
                            </MenuItem>
                            <MenuItem Header="Excel Workbook" Name="NewExcelWorkbookMenuItem" Click="NewExcelWorkbookMenuItem_Click">
                                <MenuItem.Icon>
                                    <Image Source="Images/lg_icxlsx.png" />
                                </MenuItem.Icon>
                            </MenuItem>
                            <MenuItem Header="PowerPoint presentation" Name="NewPowerPointPresentationMenuItem" Click="NewPowerPointPresentationMenuItem_Click">
                                <MenuItem.Icon>
                                    <Image Source="Images/lg_icpptx.png" />
                                </MenuItem.Icon>
                            </MenuItem>
                            <MenuItem Header="OneNote notebook" Name="NewOneNoteNotebookMenuItem" Click="NewOneNoteNotebookMenuItem_Click">
                                <MenuItem.Icon>
                                    <Image Source="Images/lg_icont.png" />
                                </MenuItem.Icon>
                            </MenuItem>
                        </ContextMenu>
                    </Button.ContextMenu>
                </Button>
                <Button ToolTip="Synhronize" BorderThickness="0" Width="25" Height="21" VerticalAlignment="Top" HorizontalAlignment="Left" Click="SynchronizeButton_Click" Background="Transparent" Name="SynchronizeButton">
                    <Button.Content>
                        <StackPanel Orientation="Horizontal">
                            <Image Source="Images/Synhronize.png" Height="20" Width="20" />
                        </StackPanel>
                    </Button.Content>
                </Button>
                <Button ToolTip="Select a view" BorderThickness="0" Width="25" Height="21" VerticalAlignment="Top" HorizontalAlignment="Left" Click="SelectViewButton_Click" Background="Transparent" Name="SelectViewButton">
                    <Button.Content>
                        <StackPanel Orientation="Horizontal">
                            <Image Source="Images/Views.png" Height="22" Width="22" />
                        </StackPanel>
                    </Button.Content>
                    <Button.ContextMenu>
                        <ContextMenu Name="SelectViewButtonContextMenu">
                        </ContextMenu>
                    </Button.ContextMenu>
                </Button>
            </StackPanel>
            <StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
                <my1:SearchTextBox Visibility="Visible" Height="18" x:Name="searchTextBox1" SearchMode="Delayed" TextChanged="searchTextBox1_TextChanged" Margin="2,2,0,0" Width="69" />
                <Button Height="17" Width="10" Name="PreviousButton" Click="PreviousButton_Click" IsEnabled="True" Margin="5,0,0,0" BorderThickness="0" >
                    <Button.Background>
                        <ImageBrush ImageSource="/Sobiens.Connectors.WPF.Controls;component/Images/Previous.PNG" />
                    </Button.Background>
                </Button>
                <Label Content="1 - 100" Height="20" x:Name="PagingLabel" Margin="5,0,5,0" FontSize="9" Width="38" />
                <Button Height="17" Name="NextButton" Width="10" Click="NextButton_Click" IsEnabled="True" Margin="0,0,5,0" BorderThickness="0">
                    <Button.Background>
                        <ImageBrush ImageSource="/Sobiens.Connectors.WPF.Controls;component/Images/Next.PNG" />
                    </Button.Background>
                </Button>
            </StackPanel>
            <ListView Grid.Row="1" Grid.ColumnSpan="2" Name="LibraryContentDataListView" Margin="0,0,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
        BorderThickness="0" MouseDoubleClick="LibraryContentDataGridView_MouseDoubleClick"
              Height="{Binding Rows[2].Height, 
              RelativeSource={RelativeSource Mode=FindAncestor, 
                                 AncestorType={x:Type Grid }}}" 
                      ItemContainerStyle="{StaticResource ItemContStyle}"
               ContextMenuOpening="LibraryContentDataGridView_ContextMenuOpening"
               ItemsSource="{Binding SourceTable}" SelectionMode="Single" VerticalContentAlignment="Stretch" DockPanel.Dock="Top" HorizontalContentAlignment="Stretch" Background="{x:Null}">
                <ListView.View>
                    <GridView  x:Name="GridViewControl">
                        <GridViewColumn Header="{DynamicResource Title}" DisplayMemberBinding="{Binding Path=Title}" Width="123" />
                    </GridView>
                </ListView.View>

            </ListView>
        </Grid>
    </DockPanel>
</wpfc:HostControl>
